<%inherit file="/base_center.html"/>
<%block name="right_content">
<!-- 右侧内容 start -->
<div class="box-info full">
  <div class="main-header">
    <span>${_(u'第三方服务信息')}</span>
  </div>
  <div class="dev_center_module">
    <h4 class="dev_module_title">
            &nbsp
           <button type="button" class="btn-info btn-xs env_add_btn f_r"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span>${_(u'添加第三方服务')}</button>
    </h4>
     <table class="table table-bordered dev_env_table mt10" id="user_env_table">
        <thead>
            <tr>
                <th width="30%">${_(u'地址(IP或域名)')}</th>
                <th width="10%">${_(u'端口')}</th>
                <th width="10%">${_(u'用户名')}</th>
                <th width="10%">${_(u'密码')}</th>
                <th width="15%">${_(u'类别')}</th>
                <th width="10%">${_(u'启用')}</th>
                <th width="15%">${_(u'操作')}</th>
            </tr>
        </thead>
        <tbody>
        % if servers:
            % for server in servers:
                <tr class="env_record">
                    <input  type="hidden" class="server_id" disabled value="${server.id}" />
                    <td>
                        <input class="form-control server_ips" disabled value="${server.server_data.get('ip_address') or ''}" placeholder="${_(u'请输入服务器地址, 存在多个用英文分号分隔')}"/>
                    </td>
                    <td>
                        <input  type="number" min="1" max="65535" class="form-control server_port" disabled value="${server.server_data.get('ip_port', '')}" placeholder="${_(u'请输入端口')}"/>
                    </td>
                    <td>
                        <input class="form-control username" disabled value="${server.server_data.get('username', '')}" placeholder="${_(u'请输入用户名')}"/>
                    </td>
                    <td>
                        <input class="form-control password" disabled value="${server.server_data.get('password', '')}" placeholder="${_(u'请输入密码')}"/>
                    </td>
                    <td>
                        <select class="form-control server_cate" disabled placeholder="${_(u'请选择服务器类型')}">
                            % for cate in third_cates:
                                <option value="${cate[0]}" ${'selected' if server.category=='${cate[0]}' else ''} >${cate[1]}</option>
                            % endfor
                        </select>
                    </td>
                    <td>
                        <span class="server_active" data="${'1' if server.is_active else '0'}">
                          % if server.is_active:
                          ${_(u'是')}
                          % else:
                          ${_(u'否')}
                          % endif
                        </span>
                    </td>
                    <td>
                        <button type="button" class="btn-info btn-xs env_save_btn">${_(u'保存')}</button>
                        <button type="button" class="btn-xs env_cancel_btn">${_(u'取消')}</button>
                        % if not server.is_active:
                            <a href="###" title="${_(u'编辑')}" class="dev_env_opera env_edit_btn"><span aria-hidden="true" class="glyphicon glyphicon-edit"></span></a>
                        % endif
                        <a href="###" value="${server.id}" title="${_(u'删除')}" class="dev_env_opera env_del_btn"><span aria-hidden="true" class="glyphicon glyphicon-remove-circle"></span></a>
                        % if not server.is_active:
                            <a href="###" title="${_(u'激活')}" class="dev_env_opera env_active_btn"><span aria-hidden="true" class="glyphicon glyphicon-saved"></span></a>
                        % else:
                            <a href="###" title="${_(u'刷新')}" class="dev_env_opera env_refresh_btn"><span aria-hidden="true" class="glyphicon  glyphicon-refresh"></span></a>
                        % endif
                    </td>
                </tr>
            % endfor
        % else:
            <tr id="no_record_row"><td colspan="8"><center>${_(u'没有第三方服务信息')}</center></td></tr>
        % endif
        </tbody>
    </table>
    <h4 class="dev_module_title mt30">${_(u'使用说明')}</h4>
    <div class="env_introduce_box">
      <p>${_(u'RabbitMQ服务是用来做应用后台任务（celery任务）的消息队列 ')}</p>
      <p>${_(u'RabbitMQ服务可部署在任意一台服务器上，但需保证')}<code>15672</code>${_(u'和')}<code>5672</code>${_(u'端口未被占用')}</p>
        <p>${_(u'如果搭建RabbitMQ服务集群, 需确保集群所有节点配置的用户名/密码/端口一致 ')}</p>
        <p>${_(u'端口默认')}<code>15672</code>(${_(u'一般不需要更改) ')}</p>
        <p>${_(u'只能激活一个RabbitMQ服务集群 ')}</p>


    </div>
  </div>
</div>
</%block>
<script src="${STATIC_URL}js/paas_engine_third.${JS_SUFFIX}"></script>
